clear all

set more off
set scheme modern

if c(username)=="" { //insert username
cd "" // insert root path
}

if c(username)=="jmc4qg" {
cd "/Users/jmc4qg/The Lab Dropbox/Jonathan Colmer/Intergenerational_Presentation/Submissions/JPE - Micro/Figure_Replication/"
}

** Fig B5a **

import delimited "Data/FigB5.csv", encoding(ISO-8859-1) clear
keep if v7 == "FigB5a.csv"
drop v1 v4 v5 v7

rename v6 year
rename v2 estimate
rename v3 stderror

sort year

gen u = estimate + 1.96*stderror
gen d = estimate - 1.96*stderror

twoway(line u year, fcolor(black) lcolor(black) lw(thin) lpattern(dash))(line d year, fcolor(black) lcolor(black) lw(thin) lpattern(dash))(line estimate year, lcolor(black) lpattern(solid) lwidth(medthick) legend(off) ///
ytitle("Change in Quality Time Spent" "with Children (Minutes)", size(large)) xtitle("Year", size(large)) graphregion(color(white)) plotregion(color(white)) xlabel(1969(1)1975, labsize(large)) xline(1971) ///
ylabel(-120(30)120, labsize(large)) yline(0))
graph export "Figures/FigB5a.pdf", replace

** Fig B5b **

import delimited "Data/FigB5.csv", encoding(ISO-8859-1) clear
keep if v7 == "FigB5b.csv"
drop v1 v4 v5 v7

rename v6 year
rename v2 estimate
rename v3 stderror

sort year

gen u = estimate + 1.96*stderror
gen d = estimate - 1.96*stderror

twoway(line u year, fcolor(black) lcolor(black) lw(thin) lpattern(dash))(line d year, fcolor(black) lcolor(black) lw(thin) lpattern(dash))(line estimate year, lcolor(black) lpattern(solid) lwidth(medthick) legend(off) ///
ytitle("Change in Quality Time Spent" "with Children (Minutes)", size(large)) xtitle("Year", size(large)) graphregion(color(white)) plotregion(color(white)) xlabel(1969(1)1975, labsize(large)) xline(1971) ///
ylabel(-120(30)120, labsize(large)) yline(0))
graph export "Figures/FigB5b.pdf", replace

** Fig B5c **

import delimited "Data/FigB5.csv", encoding(ISO-8859-1) clear
keep if v7 == "FigB5c.csv"
drop v1 v4 v5 v7

rename v6 year
rename v2 estimate
rename v3 stderror

sort year

gen u = estimate + 1.96*stderror
gen d = estimate - 1.96*stderror

twoway(line u year, fcolor(black) lcolor(black) lw(thin) lpattern(dash))(line d year, fcolor(black) lcolor(black) lw(thin) lpattern(dash))(line estimate year, lcolor(black) lpattern(solid) lwidth(medthick) legend(off) ///
ytitle("Change in Quality Time Spent" "with Children (Minutes)", size(large)) xtitle("Year", size(large)) graphregion(color(white)) plotregion(color(white)) xlabel(1969(1)1975, labsize(large)) xline(1971) ///
ylabel(-120(30)120, labsize(large)) yline(0))
graph export "Figures/FigB5c.pdf", replace

** Fig B5d **

import delimited "Data/FigB5.csv", encoding(ISO-8859-1) clear
keep if v7 == "FigB5d.csv"
drop v1 v4 v5 v7

rename v6 year
rename v2 estimate
rename v3 stderror

sort year

gen u = estimate + 1.96*stderror
gen d = estimate - 1.96*stderror

twoway(line u year, fcolor(black) lcolor(black) lw(thin) lpattern(dash))(line d year, fcolor(black) lcolor(black) lw(thin) lpattern(dash))(line estimate year, lcolor(black) lpattern(solid) lwidth(medthick) legend(off) ///
ytitle("Change in Quality Time Spent" "with Children (Minutes)", size(large)) xtitle("Year", size(large)) graphregion(color(white)) plotregion(color(white)) xlabel(1969(1)1975, labsize(large)) xline(1971) ///
ylabel(-120(30)120, labsize(large)) yline(0))
graph export "Figures/FigB5d.pdf", replace

** Fig B5e **

import delimited "Data/FigB5.csv", encoding(ISO-8859-1) clear
keep if v7 == "FigB5e.csv"
drop v1 v4 v5 v7

rename v6 year
rename v2 estimate
rename v3 stderror

sort year

gen u = estimate + 1.96*stderror
gen d = estimate - 1.96*stderror

twoway(line u year, fcolor(black) lcolor(black) lw(thin) lpattern(dash))(line d year, fcolor(black) lcolor(black) lw(thin) lpattern(dash))(line estimate year, lcolor(black) lpattern(solid) lwidth(medthick) legend(off) ///
ytitle("Change in Quality Time Spent" "with Children (Minutes)", size(large)) xtitle("Year", size(large)) graphregion(color(white)) plotregion(color(white)) xlabel(1969(1)1975, labsize(large)) xline(1971) ///
ylabel(-120(30)120, labsize(large)) yline(0))
graph export "Figures/FigB5e.pdf", replace
